xenoprof: force use of architectural perfmon instead of the CPU
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 15 Sep 2009 09:08:12 +0000 (10:08 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 15 Sep 2009 09:08:12 +0000 (10:08 +0100)
specific event set, which may be not supported by oprofile user space
tool yet.

Signed-off-by: Yang Zhang <yang.zhang@intel.com>
Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
xen/arch/x86/oprofile/nmi_int.c

index d05d7a360c4f0e73ede75a947da61e973494d57b..07050457f3212d2d04096f8f610275420731a8c5 100644 (file)
@@ -344,11 +344,26 @@ static int __init p4_init(char ** cpu_type)
 }
 
 
+static int force_arch_perfmon;
+static int force_cpu_type(const char *str)
+{
+       if (!strcmp(str, "arch_perfmon")) {
+               force_arch_perfmon = 1;
+               printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
+       }
+
+       return 0;
+}
+custom_param("cpu_type", force_cpu_type);
+
 extern int ppro_has_global_ctrl;
 static int __init ppro_init(char ** cpu_type)
 {
        __u8 cpu_model = current_cpu_data.x86_model;
 
+       if (force_arch_perfmon && cpu_has_arch_perfmon)
+               return 0;
+
        switch (cpu_model) {
        case 0 ... 2:
                *cpu_type = "i386/ppro";